$(function() {
	$('#vue_vm_list div').hide();
});

var floor = {
	floorId: '',
	buildingId: '',
	buildingName: '',
	buildingAliases: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
	remark: '',
	floorName: '',
};

var view = {
	data: floor
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view
});

function save() {
	save_basic(path+'/floor/save', {floor:view.data}, function() {
		alert('保存成功');
		
		var buildingId = $('#building_cond_select').val();
		if(load_floor_by_buildingId) {
			load_floor_by_buildingId(buildingId);
		}
	});
}

load_floor_by_buildingId = function(buildingId) {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
	if(!buildingId || buildingId=='') {return;}

	find_basic_by_json(path+'/floor/find', {buildingId: buildingId}, function(response) {
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			}
		});
		
		$('#vue_vm_list div').show();
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/floor/deleteBatch');
}
